#include <cellcsp.h>
#include <string>
#include <stdio.h>
#include <csp_debug.h>




int main(){

	char *worker    = "worker_process";
	char *init      = "init_process";
	char *farmer    = "farmer_process";
	char *harvester = "harvester_process";
	char *verifier  = "verifier_process";
	
	CSPConfig conf;

	conf.add_csp_program("./tasks/fh_test_worker_process",    worker   );
	conf.add_csp_program("./tasks/fh_test_init_process",      init     );
	conf.add_csp_program("./tasks/fh_test_farmer_process",    farmer   );
	conf.add_csp_program("./tasks/fh_test_harvester_process", harvester);
	conf.add_csp_program("./tasks/fh_test_verifier_process",  verifier );


	//CellCSP_start(conf, &kernel);
	CellCSP_start(conf);


	Parallel par(
	/* Processes: init, farmer, harvester, verifier. */
	new CSPProcess(init), new CSPProcess(farmer), new CSPProcess(harvester), 
	new CSPProcess(verifier),
	/* 25 workers */
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), new CSPProcess(worker), new CSPProcess(worker), 
	new CSPProcess(worker), NULL
	);
	par.Run();


	CellCSP_end();
	
	return 0;
}
